﻿using System;
using GeoAPI.Geometries;
using NetTopologySuite.Algorithm;

namespace NetTopologySuite.Operation.Relate
{
	public class RelateOp : GeometryGraphOperation
	{
		public static IntersectionMatrix Relate(IGeometry a, IGeometry b)
		{
			return new RelateOp(a, b).IntersectionMatrix;
		}

		public static IntersectionMatrix Relate(IGeometry a, IGeometry b, IBoundaryNodeRule boundaryNodeRule)
		{
			return new RelateOp(a, b, boundaryNodeRule).IntersectionMatrix;
		}

		public RelateOp(IGeometry g0, IGeometry g1) : base(g0, g1)
		{
			this._relate = new RelateComputer(this.arg);
		}

		public RelateOp(IGeometry g0, IGeometry g1, IBoundaryNodeRule boundaryNodeRule) : base(g0, g1, boundaryNodeRule)
		{
			this._relate = new RelateComputer(this.arg);
		}

		public IntersectionMatrix IntersectionMatrix
		{
			get
			{
				return this._relate.ComputeIM();
			}
		}

		private readonly RelateComputer _relate;
	}
}
